Repository navigation
power-guard: add RestartPreventExitStatus=2 to the NixOS service - #6517
Conversation
The daemon exits with status 2 on an invalid timing override (timing_from_env, the only SystemExit site) so a misconfigured unit shows as failed, but Restart=always restarted it every 10s forever. RestartPreventExitStatus=2 leaves the unit failed instead. Refs #6502 (task 11031)
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 16 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Fixes #6502. Queue task 11031 (follow-up from triage task 11029).
The power-guard daemon exits with status 2 on an invalid timing override (
timing_from_envin power-guard.py — the only SystemExit site, contract live since PR #6485 / #6477 merged) so a misconfigured unit shows as failed. But the NixOS service hadRestart = "always"with noRestartPreventExitStatus, so systemd restarted it every 10s forever instead.Change: one line in
nixos/services/power-guard/default.nixserviceConfig:Verification:
python3 -m unittest nixos.services.power-guard.test_power_guard— 8 tests, OK (pytest not installed on the laptop; the suite is unittest-based)nix-instantiate --parse nixos/services/power-guard/default.nix— OKOpen in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.